﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using fmtx.Framework.Model;

namespace com.fmtx.IDal
{
    public interface IBase<T> where T :BaseBean
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="bean">新实体</param>
        /// <returns></returns>
        bool Add(T bean);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="bean">新实体</param>
        /// <returns></returns>
        bool Update(T bean);

        /// <summary>
        /// 通过id删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        bool Delete(int id);

        /// <summary>
        /// 获取单个实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        T Get(int id);

        /// <summary>
        /// 获取所有数据
        /// </summary>
        /// <returns></returns>
        IEnumerable<T> GetAll();
    }
}
